#include <stdio.h>
int main() {
    int num, digit, temp, count = 0;
    printf("请输入一个不多于5位的正整数:");
    scanf("%d", &num);
    temp = num;
    while (temp != 0) {
        temp /= 10;
        count++;
    }
    printf("它是%d位数\n", count);
    printf("各位数字依次为：");
    temp = num;
    switch (count) {
        case 5:
            printf("%d ", temp / 10000);
            temp %= 10000;
        case 4:
            printf("%d ", temp / 1000);
            temp %= 1000;
        case 3:
            printf("%d ", temp / 100);
            temp %= 100;
        case 2:
            printf("%d ", temp / 10);
            temp %= 10;
        case 1:
            printf("%d ", temp);
            break;
        default:
            printf("输入有问题");
    }
    printf("\n逆序数字为：");
    temp = num;
    while (temp != 0) {
        digit = temp % 10;
        printf("%d", digit);
        temp /= 10;
    }
    printf("\n");
    return 0;
}